<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8" />
    <!-- <meta name="viewport"
    content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" /> -->
    <meta
      name="viewport"
      content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no"
    />
    <meta
      name="format-detection"
      content="telephone=no,email=no,date=no,address=no"
    />
    <title>index</title>
  </head>

  <body>
    <div id="tree-loading" class="">
      <span>加载中...</span>
    </div>
  </body>
</html>
<script></script>
<script type="text/javascript">
  var url = "./home.html",
    serv = ""; // You can change the main entry in 'production' ENV
  if ("<%= htmlWebpackPlugin.options.env %>" === "development") {
    serv = "http://192.168.0.111:8088/"; // You can change the main entry in 'development' ENV
  }
  //加载frame
  function toReplaces(_paths, _params) {
    _params = _params ? JSON.parse(_params) : {};
    var _pathsStr = _paths.substr(2);
    api.openFrame({
      name: _pathsStr,
      url: serv + _paths + ".html",
      pageParam: _params || {},
      overScrollMode: "scrolls"
    });
  }
  apiready = function() {
    api.openFrame({
      name: "treeIndex",
      url: serv + url,
      rect: {
        x: 0,
        y: 0,
        w: api.winWidth,
        h: api.winHeight
      }
    });
    // 云修复后重启
    api.addEventListener(
      {
        name: "smartupdatefinish"
      },
      function(ret, err) {
        var msg = "";
        if (ret.value && ret.value.length && ret.value[0].extra) {
          msg = ret.value[0].extra || "";
        }
        api.alert(
          {
            title: msg ? "更新完成" : "",
            msg: msg ? msg : "更新完成"
          },
          function() {
            api.rebootApp();
          }
        );
      }
    );
  };
</script>
